package com.doudizu.shoesonline.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.doudizu.shoesonline.model.dto.user.UserDTO;
import com.doudizu.shoesonline.model.dto.user.UserQuery;
import com.doudizu.shoesonline.model.entity.User;
import com.doudizu.shoesonline.model.vo.UserVO;

import java.util.List;

/**
* 
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2023-07-03 09:55:55
*/
public interface UserService extends IService<User> {

    /**
     * 获取当前登录用户
     *
     * @return
     */
    User getLoginUser();

    /**
     * 用户注册
     *
     * @param user
     * @return
     */
    void userRegister(UserDTO user);

    /**
     * 用户登录
     *
     * @param userAccount  用户账户
     * @param userPassword 用户密码
     * @return 脱敏后的用户信息
     */
    String userLogin(String userAccount, String userPassword);

    boolean userLogout(String token);

    IPage<User> getUsers(UserQuery userQuery);

    List<User> searchUsers(String gender, String userName);

    UserVO getUser(Integer userId);

    boolean updateUser(UserDTO user);

    boolean reset(String password,String account,String answer);

    void sendEmailCode(String email);

    void addUser(UserDTO user);
}
